package cn.daichi.elasticsearchdemo;

import cn.daichi.elasticsearchdemo.service.SearchService;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

@Component
public class ApplicationStartUpRunner implements ApplicationRunner {

    private SearchService searchService;

    public ApplicationStartUpRunner(SearchService searchService) {
        this.searchService = searchService;
    }

    @Override
    public void run(ApplicationArguments args) throws Exception {
        searchService.initEsData();
    }

}
